defmodule ChoicePlayground.QuestionContent do
  use ChoicePlayground.Web, :model

  schema "question_content" do
    field :seq, :integer
    field :count, :integer
    field :content, :string
    belongs_to :question, ChoicePlayground.Question

    timestamps()
  end

  @doc """
  Builds a changeset based on the `struct` and `params`.
  """
  def changeset(struct, params \\ %{}) do
    struct
    |> cast(params, [:seq, :count, :content])
    |> validate_required([:seq, :count, :content])
  end
end
